package com.lostandfound.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "laf_thanks_t")
public class ThanksLetter implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long lid;//ID
	private String ltitle;//主题
	private String lcontent;//内容
	private Date l_create_time;//发布时间
	private Long zan = (long) 0;//点赞数
	private String lstatus = "0";//状态 0:正常,1:删除
	private Topic topic;//所属主贴
	private Plate plate;//所属模块
	private User user;//发表人
	

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "l_id", unique = true, nullable = false, length = 8)
	public Long getLid() {
		return lid;
	}
	public void setLid(Long lid) {
		this.lid = lid;
	}
	
	
	@Column(name = "zan",nullable = true)
	public Long getZan() {
		return zan;
	}
	public void setZan(Long zan) {
		this.zan = zan;
	}
	@Column(name = "l_title",nullable = false, length = 60)
	public String getLtitle() {
		return ltitle;
	}
	public void setLtitle(String ltitle) {
		this.ltitle = ltitle;
	}
	
	@Column(name = "l_content",nullable = false, length = 600)
	public String getLcontent() {
		return lcontent;
	}
	public void setLcontent(String lcontent) {
		this.lcontent = lcontent;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "l_create_time", length = 7)
	public Date getL_create_time() {
		return l_create_time;
	}
	public void setL_create_time(Date l_create_time) {
		this.l_create_time = l_create_time;
	}

	@Column(name = "l_status",nullable = false, length = 1)
	public String getLstatus() {
		return lstatus;
	}
	public void setLstatus(String lstatus) {
		this.lstatus = lstatus;
	}
	
	@ManyToOne
	@JoinColumn(name="tid")
	public Topic getTopic() {
		return topic;
	}
	public void setTopic(Topic topic) {
		this.topic = topic;
	}
	
	@ManyToOne
	@JoinColumn(name="pid")
	public Plate getPlate() {
		return plate;
	}
	public void setPlate(Plate plate) {
		this.plate = plate;
	}
	
	@ManyToOne
	@JoinColumn(name="id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}
